<template>
  <div class="app-container">
    <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="auto" size="small">
      <el-form-item label="更新时间" prop="releaseTime">
        <el-date-picker
          v-model="dateRange"
          end-placeholder="结束日期"
          range-separator="-"
          start-placeholder="开始日期"
          style="width: 240px"
          type="daterange"
          value-format="yyyy-MM-dd"
        />
      </el-form-item>
      <el-form-item label="车辆行业类别" prop="industryType">
        <el-select v-model="queryParams.industryType" clearable placeholder="请选择车辆行业类别">
          <el-option
            v-for="dict in dict.type.bhxq_car_industry_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="车辆型号类别" prop="modelType">
        <el-select v-model="queryParams.modelType" clearable placeholder="请选择车辆型号类别">
          <el-option
            v-for="dict in dict.type.bhxq_car_model_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <!--      <el-form-item label="车牌照号" prop="currentCarNum">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.currentCarNum"-->
      <!--          clearable-->
      <!--          placeholder="请输入当前车牌照号"-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item label="车辆状态类型" prop="carStatus">
        <el-select v-model="queryParams.carStatus" clearable placeholder="请选择车辆状态类型">
          <el-option
            v-for="dict in dict.type.bhxq_car_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="车辆证件状态" prop="carCertStatus">
        <el-select v-model="queryParams.carCertStatus" clearable placeholder="请选择车辆状态类型">
          <el-option
            v-for="dict in dict.type.bhxq_car_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          icon="el-icon-plus"
          plain
          size="mini"
          type="primary"
          @click="handleAdd"
        >新增</el-button>
      </el-col>
<!--      <el-col :span="1.5">-->
<!--        <el-upload-->
<!--            class="upload-demo"-->
<!--            style="float: right"-->
<!--            :show-file-list="false"-->
<!--        >-->
<!--          <el-button size="mini" icon="el-icon-download" plain type="warning">导入</el-button>-->
<!--        </el-upload>-->
<!--      </el-col>-->
      <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
    </el-row>

    <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
      <el-table-column align="center" label="更新时间" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <!--      <el-table-column align="center" label="企业名称" prop="enterpriseId" />-->
      <el-table-column align="center" label="车辆行业类别" prop="industryType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bhxq_car_industry_type" :value="scope.row.industryType" />
        </template>
      </el-table-column>
      <el-table-column align="center" label="车辆型号类别" prop="modelType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bhxq_car_model_type" :value="scope.row.modelType" />
        </template>
      </el-table-column>
      <el-table-column align="center" label="车辆状态类型" prop="carStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bhxq_car_status" :value="scope.row.carStatus" />
        </template>
      </el-table-column>
      <el-table-column align="center" label="车辆证件状态" prop="carCertStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.bhxq_car_status" :value="scope.row.carCertStatus" />
        </template>
      </el-table-column>
      <el-table-column align="center" label="是否具备GPS" prop="gps">
        <template slot-scope="scope">
          {{ scope.row.gps == null ? null : scope.row.gps == '1' ? '有' : '无' }}
        </template>
      </el-table-column>
      <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            @click="handleexamine(scope.row)"
          >查看</el-button>
          <el-button
            size="mini"
            type="text"
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            @click="handleDelete(scope.row)"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :limit.sync="queryParams.pageSize"
      :page.sync="queryParams.pageNum"
      :total="total"
      @pagination="getList"
    />

    <!-- 添加或修改客货运车基本信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
      <el-form ref="form" :model="form" :rules="rules" label-width="210px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆行业类别" prop="industryType">
              <el-select v-model="form.industryType" :disabled="disabledon" placeholder="请选择车辆行业类别" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_industry_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆型号类别" prop="modelType">
              <el-select v-model="form.modelType" :disabled="disabledon" placeholder="请选择车辆型号类别" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_model_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="当前车牌照号" prop="currentCarNum">
              <el-input v-model="form.currentCarNum" :disabled="disabledon" placeholder="请输入当前车牌照号" style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车身颜色" prop="carColour">
              <el-input v-model="form.carColour" :disabled="disabledon" placeholder="请输入车身颜色" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车标" prop="carLogo">
              <el-input v-model="form.carLogo" :disabled="disabledon" placeholder="请输入车标" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆状态类型" prop="carStatus">
              <el-select v-model="form.carStatus" :disabled="disabledon" placeholder="请选择车辆状态类型" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆产权单位" prop="carOwnershipOrg">
              <el-input v-model="form.carOwnershipOrg" :disabled="disabledon" placeholder="请输入车辆产权单位" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆产权证号" prop="carOwnershipCode">
              <el-input v-model="form.carOwnershipCode" :disabled="disabledon" placeholder="请输入车辆产权证号" style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆产权变更日期" prop="carOwnershipChangeDate">
              <el-date-picker
                v-model="form.carOwnershipChangeDate"
                :disabled="disabledon"
                clearable
                placeholder="请选择车辆产权变更日期"
                style="width: 100%"
                type="date"
                value-format="yyyy-MM-dd"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆宽度（单位：米）" prop="carWidth">
              <el-input-number v-model="form.carWidth" :disabled="disabledon" :min="0" :precision="2" :step="1" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆高度（单位：米）" prop="carHeight">
              <el-input-number v-model="form.carHeight" :disabled="disabledon" :min="0" :precision="2" :step="1" style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆长度（单位：米）" prop="carLength">
              <el-input-number v-model="form.carLength" :disabled="disabledon" :min="0" :precision="2" :step="1" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆轴数" prop="carAxleNum">
              <el-select v-model="form.carAxleNum" :disabled="disabledon" placeholder="请选择车辆轴数" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_axle_num"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="燃料类型" prop="fuelType">
              <el-select v-model="form.fuelType" :disabled="disabledon" placeholder="请选择燃料类型" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_fuel_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆最大载质量（单位：kg）" prop="carMaxLoad">
              <el-input-number v-model="form.carMaxLoad" :disabled="disabledon" :min="0" :precision="2" :step="1" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆总质量（单位：kg）" prop="carTotalMass">
              <el-input-number v-model="form.carTotalMass" :disabled="disabledon" :min="0" :precision="2" :step="1" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆证件类型" prop="carCertType">
              <el-select v-model="form.carCertType" :disabled="disabledon" placeholder="请选择车辆证件类型" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_cert_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆证件编号" prop="carCertCode">
              <el-input v-model="form.carCertCode" :disabled="disabledon" placeholder="请输入车辆证件编号" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆发证机关" prop="carCertOrg">
              <el-input v-model="form.carCertOrg" :disabled="disabledon" placeholder="请输入车辆发证机关" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆证件有效期" prop="carCertLifespan">
              <el-date-picker
                v-model="form.carCertLifespan"
                :disabled="disabledon"
                clearable
                placeholder="请选择车辆证件有效期"
                style="width: 100%"
                type="date"
                value-format="yyyy-MM-dd"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆证件状态" prop="carCertStatus">
              <el-select v-model="form.carCertStatus" :disabled="disabledon" placeholder="请选择车辆证件状态" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.bhxq_car_cert_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆初次发证日期" prop="firstDateIssue">
              <el-date-picker
                v-model="form.firstDateIssue"
                :disabled="disabledon"
                clearable
                placeholder="请选择车辆初次发证日期"
                style="width: 100%"
                type="date"
                value-format="yyyy-MM-dd"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆本次发证日期" prop="currentDateIssue">
              <el-date-picker
                v-model="form.currentDateIssue"
                :disabled="disabledon"
                clearable
                placeholder="请选择车辆本次发证日期"
                style="width: 100%"
                type="date"
                value-format="yyyy-MM-dd"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆证件有效截至日期" prop="deadlineDate">
              <el-date-picker
                v-model="form.deadlineDate"
                :disabled="disabledon"
                clearable
                placeholder="请选择车辆证件有效截至日期"
                style="width: 100%"
                type="date"
                value-format="yyyy-MM-dd"
              />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆所属省" prop="province">
              <el-input v-model="form.province" :disabled="disabledon" placeholder="请输入车辆所属省" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="车辆所属市" prop="city">
              <el-input v-model="form.city" :disabled="disabledon" placeholder="请输入车辆所属市" style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="车辆所属县" prop="county">
              <el-input v-model="form.county" :disabled="disabledon" placeholder="请输入车辆所属县" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="是否具备GPS" prop="gps">
              <el-select v-model="form.gps" :disabled="disabledon" placeholder="请选择是否具备GPS" style="width: 100%">
                <el-option
                  v-for="dict in equippedJpsList"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" />
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="!disabledon" type="primary" @click="submitForm">确 定</el-button>
        <el-button v-if="!disabledon && title !== '修改运营车辆'" type="primary" @click="submitForm('ContinueFill')">确定并继续填写</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
// import { listInfo, getInfo, delInfo, addInfo, updateInfo } from '@/api/bhxq/passengervehicleinformation'
// import { getEnterprise } from '../../../api/bhxq/passengervehicleinformation'

import { addInfo, listInfo, getInfo, updateInfo, delInfo } from '@/api/informationReport'

export default {
  name: 'Index',
  dicts: ['bhxq_car_industry_type', 'bhxq_car_model_type', 'bhxq_car_status', 'bhxq_car_fuel_type', 'bhxq_car_cert_type', 'bhxq_car_cert_status', 'bhxq_common_on_off', 'bhxq_axle_num'],
  data() {
    return {
      // 日期范围
      dateRange: [],
      disabledon: true,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 客货运车基本信息表格数据
      infoList: [{}],
      // 企业列表
      enterprise: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        enterpriseId: null,
        industryType: null,
        modelType: null,
        currentCarNum: null,
        carColour: null,
        carLogo: null,
        carStatus: null,
        carOwnershipOrg: null,
        carOwnershipCode: null,
        carOwnershipChangeDate: null,
        carOwnershipOriginalOrg: null,
        carWidth: null,
        carHeight: null,
        carLength: null,
        carAxleNum: null,
        fuelType: null,
        carMaxLoad: null,
        carTotalMass: null,
        carCertType: null,
        carCertCode: null,
        carCertOrg: null,
        carCertLifespan: null,
        carCertStatus: null,
        firstDateIssue: null,
        currentDateIssue: null,
        deadlineDate: null,
        carCertOriginalCode: null,
        seatNum: null,
        province: null,
        city: null,
        county: null,
        businessType: null
      },

      queryParamslist: {
        enterpriseId: null
      },
      // 车辆行业类别字典
      industryTypeList: [],
      // 车辆型号类别字典
      modelCateList: [],
      // 车辆状态类型字典
      statusTypeList: [],
      // 燃料类别字典
      fuelCategoryList: [],
      // 车辆证件类型字典
      vehicleIDType: [],
      // 车辆证件状态字典
      vehicleIdStatus: [],
      // 是否具备JPS字典
      equippedJpsList: [
        {
          label: '有',
          value: '1'
        },
        {
          label: '无',
          value: '0'
        }
      ],
      // 车辆轴数字典
      vehicleAxlesList: [],
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        enterpriseId: [
          { required: true, message: '企业不能为空', trigger: 'blur' }
        ],
        industryType: [
          { required: true, message: '车辆行业类别不能为空', trigger: 'change' }
        ],
        modelType: [
          { required: true, message: '车辆型号类别不能为空', trigger: 'change' }
        ],
        currentCarNum: [
          { required: true, message: '当前车牌照号不能为空', trigger: 'blur' }
        ],
        carColour: [
          { required: true, message: '车身颜色不能为空', trigger: 'blur' }
        ],
        // carLogo: [
        //   { required: true, message: '车标不能为空', trigger: 'blur' }
        // ],
        // carCertStatus: [
        //   { required: true, message: '车辆证件状态类型不能为空', trigger: 'change' }
        // ],
        carOwnershipOrg: [
          { required: true, message: '车辆产权单位不能为空', trigger: 'blur' }
        ],
        carOwnershipCode: [
          { required: true, message: '车辆产权证号不能为空', trigger: 'blur' }
        ],
        carOwnershipChangeDate: [
          { required: true, message: '车辆产权变更日期不能为空', trigger: 'blur' }
        ],
        carOwnershipOriginalOrg: [
          { required: true, message: '车辆原所属业户不能为空', trigger: 'blur' }
        ],
        // carWidth: [
        //   { required: true, message: '车辆宽度不能为空', trigger: 'blur' }
        // ],
        // carHeight: [
        //   { required: true, message: '车辆高度不能为空', trigger: 'blur' }
        // ],
        // carLength: [
        //   { required: true, message: '车辆长度不能为空', trigger: 'blur' }
        // ],
        // carAxleNum: [
        //   { required: true, message: '车辆轴数不能为空', trigger: 'change' }
        // ],
        // fuelType: [
        //   { required: true, message: '燃料类型不能为空', trigger: 'change' }
        // ],
        // carMaxLoad: [
        //   { required: true, message: '车辆最大载质量不能为空', trigger: 'blur' }
        // ],
        // carTotalMass: [
        //   { required: true, message: '车辆总质量不能为空', trigger: 'blur' }
        // ],
        // carCertType: [
        //   { required: true, message: '车辆证件类型不能为空', trigger: 'change' }
        // ],
        // carCertCode: [
        //   { required: true, message: '车辆证件编号不能为空', trigger: 'blur' }
        // ],
        // carCertOrg: [
        //   { required: true, message: '车辆发证机关不能为空', trigger: 'blur' }
        // ],
        // carCertLifespan: [
        //   { required: true, message: '车辆证件有效期不能为空', trigger: 'blur' }
        // ],
        seatNum: [
          { required: true, message: '座位数不能为空', trigger: 'blur' }
        ],
        // gps: [
        //   { required: true, message: '是否具备gps不能为空', trigger: 'change' }
        // ],
        // firstDateIssue: [
        //   { required: true, message: '初次发证日期不能为空', trigger: 'blur' }
        // ],
        // currentDateIssue: [
        //   { required: true, message: '本次发证日期不能为空', trigger: 'blur' }
        // ],
        // deadlineDate: [
        //   { required: true, message: '有效截至日期不能为空', trigger: 'blur' }
        // ],
        carCertOriginalCode: [
          { required: true, message: '原证件编号不能为空', trigger: 'blur' }
        ],
        // province: [
        //   { required: true, message: '所属省不能为空', trigger: 'blur' }
        // ],
        // city: [
        //   { required: true, message: '所属市不能为空', trigger: 'blur' }
        // ],
        // county: [
        //   { required: true, message: '所属县不能为空', trigger: 'blur' }
        // ],
        carStatus: [
          { required: true, message: '车辆状态不能为空', trigger: 'change' }
        ]

      }
    }
  },
  created() {
    this.getList()
    // this.getEnterpriselist()
  },
  methods: {
    // 查询企业列表
    getEnterpriselist() {
      this.queryParamslist.businessType = 1
      getEnterprise(this.queryParamslist).then(response => {
        this.enterprise = response.data
      })
    },
    /** 查询客运车基本信息列表 */
    getList() {
      if (this.dateRange == null) {
        this.dateRange = []
      }
      this.loading = true
      const data = {
        industryType: this.queryParams.industryType,
        modelType: this.queryParams.modelType,
        currentCarNum: this.queryParams.currentCarNum,
        carStatus: this.queryParams.carStatus,
        carCertStatus: this.queryParams.carCertStatus,
        updateTimeStart: this.dateRange.length === 0 ? undefined : this.dateRange[0],
        updateTimeEnd: this.dateRange.length === 0 ? undefined : this.dateRange[0],
        pageNum: this.queryParams.pageNum,
        pageSize: this.queryParams.pageSize
      }
      console.log('carStatus', this.queryParams.carStatus)
      // this.queryParams.businessType = 1
      // listInfo(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listInfo(data).then(response => {
        this.infoList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 取消按钮
    cancel() {
      this.open = false
      this.reset()
    },
    // 表单重置
    reset() {
      this.form = {
        carId: null,
        enterpriseId: null,
        industryType: null,
        modelType: null,
        currentCarNum: null,
        carColour: null,
        carLogo: null,
        carStatus: null,
        carOwnershipOrg: null,
        carOwnershipCode: null,
        carOwnershipChangeDate: null,
        carOwnershipOriginalOrg: null,
        carWidth: null,
        carHeight: null,
        carLength: null,
        carAxleNum: null,
        fuelType: null,
        carMaxLoad: null,
        carTotalMass: null,
        carCertType: null,
        carCertCode: null,
        carCertOrg: null,
        carCertLifespan: null,
        carCertStatus: null,
        firstDateIssue: null,
        currentDateIssue: null,
        deadlineDate: null,
        carCertOriginalCode: null,
        seatNum: null,
        province: null,
        city: null,
        county: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        delFlag: null,
        gps: null,
        businessType: null
      }

      this.resetForm('form')
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.dateRange = []
      this.handleQuery()
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.carId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset()
      // this.getEnterpriselist()
      this.disabledon = false
      this.open = true
      this.title = '新增运营车辆'
    },
    /** 查看按钮操作 */
    handleexamine(row) {
      this.reset()
      // const carId = row.carId || this.ids
      getInfo(row.carId).then(response => {
        this.form = response.data
        this.disabledon = true
        this.open = true
        this.title = '查看运营车辆'
      })
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset()
      // const carId = row.carId || this.ids
      getInfo(row.carId).then(response => {
        this.form = response.data
        this.disabledon = false
        this.open = true
        this.title = '修改运营车辆'
      })
    },
    /** 提交按钮 */
    submitForm(type) {
      this.$refs['form'].validate(valid => {
        if (valid) {
          if (this.form.carId != null) {
            this.form.businessType = 1
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess('修改成功')
              this.open = false
              this.getList()
            })
          } else {
            this.form.businessType = 1
            addInfo(this.form).then(response => {
              this.$modal.msgSuccess('新增成功')
              // 当点击确认确定并继续填写时 模态框不关闭
              if (type === 'ContinueFill') {
                this.reset()
                this.open = true
              } else {
                this.open = false
              }
              this.getList()
            })
          }
        }
      })
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const carIds = row.carId || this.ids
      this.$modal.confirm('是否确认删除此数据项？').then(function() {
        return delInfo(carIds)
      }).then(() => {
        this.getList()
        this.$modal.msgSuccess('删除成功')
      }).catch(() => {})
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('background/bhxqCarInfo/export', {
        ...this.queryParams
      }, `info_${new Date().getTime()}.xlsx`)
    }
  }
}
</script>
<style >
.el-checkbox__input.is-disabled + .el-checkbox__label {
  color: #606266 !important;
}

.el-checkbox__input.is-disabled.is-checked + .el-checkbox__label {
  color: #606266 !important;
}

.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after {
  border-color: #606266 !important;
}

.el-radio__input.is-disabled + span.el-radio__label {
  color: #606266 !important;
}

.el-radio__input.is-disabled.is-checked .el-radio__inner::after {
  background-color: #606266 !important;
}

.el-radio__input.is-disabled .el-radio__inner, .el-radio__input.is-disabled.is-checked .el-radio__inner {
  border-color: #606266 !important;
}

.el-input.is-disabled .el-input__inner, textarea:disabled {
  color: #606266 !important;
}

.el-range-editor.is-disabled input {
  color: #606266 !important;
}
.el-tooltip__popper{

  max-width:20%;

}

.el-tooltip__popper,.el-tooltip__popper.is-dark{

  background:rgb(48, 65, 86) !important;

  color: #fff !important;

  line-height: 24px;

}
</style>

